package com.jt.springboot_demo1.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//需要通过spring容器加载配置文件，并且以utf-8的格式进行
@PropertySource(value = "classpath:/properties/redis.properties",encoding ="utf-8")
public class RedisProController {

    @Value("${redis.pro.host}")
    private String host;
    @Value("${redis.pro.port}")
    private Integer port;

    @RequestMapping("/getMsg")
    public String getMsg(){
        return host+":"+port;
    }
}
